[WIP] poc: branch-associated Chat Sessions#267139
Closed
rwoll wants to merge 8 commits intomicrosoft:mainfrom
Closed
[WIP] poc: branch-associated Chat Sessions#267139rwoll wants to merge 8 commits intomicrosoft:mainfrom
rwoll wants to merge 8 commits intomicrosoft:mainfrom
Conversation
rwoll
commented
Sep 17, 2025
Member
Author
rwoll
left a comment
There was a problem hiding this comment.
First working draft. Some higher level followups:
- when switching chat sessions, auto checkout the branch as well.
- UI treatment - when you checkout out a previous branch, it's not obvious the chat session is restored since before v. after is a wall of text. Need some UI indicator.
- Put this all behind a setting.
| { | ||
| label: i.title, | ||
| description: i.isActive ? `(${localize('currentChatLabel', 'current')})` : '', | ||
| description: i.isActive ? `(${i.createdOnBranch} - ${localize('currentChatLabel', 'current')})` : `${i.createdOnBranch}`, |
Member
Author
There was a problem hiding this comment.
use last active branch instead of createdOnBranch?
| if (suggestCtrl) { | ||
| const curText = widget.inputEditor.getValue(); | ||
| const newValue = curText ? `@ ${curText}` : '@'; | ||
| const newValue = curText ? `@${curText}` : '@'; |
Member
Author
There was a problem hiding this comment.
revert. this seems unrelated.
| override async run(accessor: ServicesAccessor): Promise<void> { | ||
| const extensionsWorkbenchService = accessor.get(IExtensionsWorkbenchService); | ||
| extensionsWorkbenchService.openSearch(`@feature:${CopilotUsageExtensionFeatureId}`); | ||
| extensionsWorkbenchService.openSearch(`@feature: ${CopilotUsageExtensionFeatureId}`); |
| export const ACTION_ID_NEW_CHAT = `workbench.action.chat.newChat`; | ||
| export const ACTION_ID_NEW_EDIT_SESSION = `workbench.action.chat.newEditSession`; | ||
| export const CHAT_OPEN_ACTION_ID = 'workbench.action.chat.open'; | ||
| export const CHAT_OPEN_HISTORICAL_SESSION_ACTION_ID = 'workbench.action.chat.openHistoricalSession'; |
Member
Author
There was a problem hiding this comment.
Suggested change
| export const CHAT_OPEN_HISTORICAL_SESSION_ACTION_ID = 'workbench.action.chat.openHistoricalSession'; | |
| export const CHAT_RESTORE_SESSION_ACTION_ID = 'workbench.action.chat.restoreSession'; |
| // Set up listener for current history item ref changes (HEAD movement) | ||
| return runOnChange(historyProvider.historyItemRef, () => { | ||
| // Fire event when the current branch reference changes | ||
| const currentBranch = this.getCurrentBranch(); |
Member
Author
There was a problem hiding this comment.
Should this use getCurrentBranch()…or does historyItemRef have the actual branch info already?
| return runOnChange(historyProvider.historyItemRef, () => { | ||
| // Fire event when the current branch reference changes | ||
| const currentBranch = this.getCurrentBranch(); | ||
| this._onChangedBranch.fire(currentBranch); |
Member
Author
There was a problem hiding this comment.
Do we need to debounce this?
| this._register(this.gitStatus.onChangedBranch(async branch => { | ||
| console.log('Branch changed to:', branch); | ||
| const history = await this.getHistory(); | ||
| const sessionId = history.find(h => h.lastUsedOnBranch === branch)?.sessionId; |
Member
Author
There was a problem hiding this comment.
Need to check ordering on this. Ensure history is sorted in an expected way. Ideally, we want the most recent session related to the branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.